{extend name="layout:base" /}{block name="content"}
 <?php
$global=isSupperManagerForSession();

 ?>

     <link rel="stylesheet" type="text/css" href="/static/My97DatePicker/skin/WdatePicker.css" />
     <script charset="utf-8" src="/static/My97DatePicker/WdatePicker.js"></script>
    <style>

 .tip{
        position:absolute;
        background:#9FC;
        border-color:#F60;
        z-index:9999;
        filter:alpha(opacity=80);  
        -moz-opacity:0.8;  
        -khtml-opacity: 0.8;  
        opacity: 0.8;  
    }
    .hidden-detail{
        display:none;
    }
    .mypointer{
	width:100%;overflow:hidden;height:25px;line-height:25px;cursor: pointer;text-align:left;
    }
    .table tr th{text-align:center;}
    </style>
    

    <section class="topBanners">
         <div class="icon"></div>
         <div class="topBannersNav">
         <span data-url="/admin/my/fjMyApplyLists" onclick="ContentLoadGo('/admin/my/fjMyApplyLists')">我的申请</span>
         </div>
      </section>
      
      <section style="margin-top:10px;margin-left:auto;margin-right:auto;">
          任务时间：
          <input name="starttime"  id="starttime" class="Wdate textbox Fselect" placeholder="开始时间"  onfocus="WdatePicker({lang:'zh-cn'})" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;" value="<?php echo $request['starttime']; ?>" size="12"  type="text">
          -<input name="endtime" id="endtime" class="Wdate textbox" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;" placeholder="结束时间"  onfocus="WdatePicker({lang:'zh-cn'})" value="<?php echo $request['endtime']; ?>" size="12" type="text">
      业务状态：<select name="stat" id="stat" class="select">
       <option value="">--选择--</option>
       <option value="0" <?php if($request['stat']=='0'){ echo 'selected';} ?> >提交</option>
       <option value="2" <?php if($request['stat']=='2'){ echo 'selected';} ?> >处理</option>
       <option value="3" <?php if($request['stat']=='3'){ echo 'selected';} ?> >拒绝</option>
       <option value="4" <?php if($request['stat']=='4'){ echo 'selected';} ?> >完成</option>

      </select>
      <input type="button" value="搜索" class="group_btn research" id="resource" page="1" />
      <?php
	    if( ( in_array(51000,$ruleLists) || $global==1) )
		{
    	?>
      <input type="button" power="51000" value="警力申请" class="group_btn addJob" />
      <?php
      }
       ?>
      <br style="clear:both;width:0px;height:0px;">
      
     </section>
   
<table class="table" style="margin-top:10px;">

<tr>

<th>任务时间</th>
<th>申请人信息</th>


<th>详情</th>

<th>处理人信息</th>
<th>处理时间</th>
<th>业务类型</th>
<th>业务状态</th>
<th>操作</th>
</tr>

<?php 
foreach($lists['data'] as $key=>$val)
{
?>
<tr data-id="<?php echo $val['id']; ?>">


<td style="width:80px;"><?php
if(!empty($val['stime']))
{
 echo date("Y-m-d",strtotime($val['stime']));
}
 ?></td>

<td style="text-align:center;width:70px;">
<?php
if($val['tuserInfo'])
{
// echo $val['tuserInfo']['uname']." ";

 echo "[".$val['tuserInfo']['nickname']."]<br>";
 if($val['tuserInfo']['depid'])
	{
 
 echo "[".$userDepList[$val['tuserInfo']['depid']]['depname']."]";
	}else
     {
echo "[".$userDepList[$val['tuserInfo']['first_depid']]['depname']."]";
    }
}
 ?>
</td>


<td style="width:250px;">

<div style="width:100%;text-align:left;">联系电话：<?php echo $val['phone'];?>&nbsp;&nbsp;警员人数：<?php echo $val['people_num']; ?>人</div>
<div class="mypointer" data-toggle="tooltip"
        data-placement="bottom" title="<?php echo $val['conts']; ?>"><?php echo $val['conts']; ?></div>

</td>
<td style="text-align:center;width:70px;">
<?php
if($val['duserInfo'])
{
 //echo $val['duserInfo']['uname']." ";

 echo "[".$val['duserInfo']['nickname']."]<br>";
if($val['duserInfo']['depid'])
{
echo "[".$userDepList[$val['duserInfo']['depid']]['depname']."]";
}else
{


 echo "[".$userDepList[$val['duserInfo']['first_depid']]['depname']."]";
} 
}
 ?>
</td>







 
 <td style="width:100px;"><?php
if(!empty($val['etime']) && $val['etime']!='0000-00-00 00:00:00')
{
 echo $val['etime'];
}
 ?></td>
 
 
  <td style="width:60px;"><?php
echo $val['tcfg'];
 ?></td>

<td style="width:40px;">
<?php
if($val['stat']==0)
{
  echo '<font style="color:red">提交</font>';
}
else if($val['stat']==2)
{
  echo '<font style="color:green">处理</font>';
}
else if($val['stat']==3)
{
  echo '<font style="color:red">拒绝</font>';
}
else if($val['stat']==4)
{
  echo '<font>完成</font>';
}
?>
</td>
<td style="width:40px;"><?php
if( ( in_array(51100,$ruleLists) || $global==1) )
{
?>
<input type="button" power="51100" value="详情" class="link_btn info"/>
<?php
}
?></td>
</tr>
      <?php
      }
	  ?>
</table>
{include file="../application/admin/view/layout/page_tpl_new.html" /}
      <script type="text/javascript">
      
      function myResearch(){
		   var url="/admin/my/fjMyApplyLists";
		   var starttime =$("#starttime").val();
		   var endtime =$("#endtime").val();
		   var stat =$("#stat").val();
		
    if(starttime!="" && endtime=="")
       {
          ErrTiShi("请选择结束日期");return false;
       }
       if(starttime=="" && endtime!="")
       {
          ErrTiShi("请选择开始日期");return false;
       }
		   var page=$("#cpage").val();
		   var param={
				   starttime:starttime, 
				   endtime:endtime, 
				   stat:stat, 
				   page:page
		   };
		   ContentLoadGo(url,param);
	   }
     
      
           $(function(){
        	   //设置搜索栏
        	   $(".research").click(function(){
        		   var page =$(this).attr("page");
        		   $("#cpage").val(page);
        		   myResearch();
        		   
        	   });
        	   
        	   //删除项
        	   $('.del').click(function(){
        		   var that =this;
        		   var url="/admin/job/delData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		   cofirmsss_tishi(1,'您确定要删除吗?',function(id){
        			 
        			   AjaxRequest(url,param,function(data){
            			   if(data.err==0)
            			   {
            				   SuccessTiShi("操作成功");
            				   
            				   $(that).parent().parent().remove();
            				   myResearch();
            			   }
            			   else
            			   {
            				   ErrTiShi("操作失败");
            			   }
            		   });
        			   
        		   });
        	   });
        	   
        	   $(".info").click(function(){
        		   var that =this;
        		   var url="/admin/my/fjInfoData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		  // MyContentLoad(url,param);
        			ContentGet(url,param)	 
        				
        			 //弹出：确认按钮
        			
        	   });
        	 
        	 
        	 //二级部门
        	   $('.nextDep').click(function(){
        		   var that =this;
        		   var url="/admin/job2/lists";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   pid:id
        		   };
        		   ContentGet(url,param);
        	   });
        	 
        	 
        	   //编辑项
        	   $(".edit").click(function(){
        		   var that =this;
        		   var url="/admin/job/editData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		   MyContentLoad(url,param);
        				 
        				
        			 //弹出：确认按钮
        			
        	   });
        	   
        	 //编辑项
        	   $(".deal").click(function(){
        		   var that =this;
        		   var url="/admin/job/deal";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		   MyContentLoad(url,param);
        				 
        				
        			 //弹出：确认按钮
        			
        	   });

        	   
        	   
        	   
        	   
        	   //编辑项
        	   $(".addJob").click(function(){
        		   
        		   var that =this;
        		   var url="/admin/my/fjMyApply";
        		   var param={};
        		   //MyContentLoad(url,param);
        		   ContentLoadGo(url,param);
        			 //弹出：确认按钮
        			
        	   });
        	   
        	   //导航
         	   $(".topBannerItem").click(function(){
         		   
         		   var attArr = $(this).attr();
             	   goToSelfLink(attArr);
             	   
         			
         	   });
  			   //全选
  		
  				$("#all").click(function(){   
			    	if(this.checked){   
			        	$(".checkBoxInput").attr("checked", true);  
			        	$(".checkBoxInput").prop("checked", true);  
			    	}else{   
						$(".checkBoxInput").attr("checked", false);
						$(".checkBoxInput").prop("checked", false);
			    	}   
			    	var se=getAllSelectItem();
			    	//console.log(se);
			 	}); 
  			   
  			
           });
           
	  </script>
	  
	  <script>
$(function (){
    //$("[data-toggle='popover']").popover();
    $("[data-toggle='tooltip']").tooltip();
});


</script>
	  {/block}
   